﻿using MugenInjection.Web.Config;
using MugenInjection.Web.Interface;

// ReSharper disable CheckNamespace

namespace MugenInjection
// ReSharper restore CheckNamespace
{
    /// <summary>
    /// Fluent api for HTTP configuration.
    /// </summary>
    public static class HttpConfigExtension
    {
        #region Methods

        /// <summary>
        /// Configures specified <see cref="IApplicationConfiguration"/> with HTTP settings. Added support for HttpRequestScope and SessionScope.
        /// </summary>
        /// <param name="configuration">The specified <see cref="IApplicationConfiguration"/></param>
        /// <returns>An instance of <see cref="IApplicationConfiguration"/>.</returns>
        public static T WithHttpConfiguration<T>(this T configuration) where T : IApplicationConfiguration
        {
            configuration.AddConfiguration(new MugenInjectionHttpApplicationConfig());
            return configuration;
        }

        #endregion
    }
}